package com.xjrsoft.module.customerTwo.barin.t_equipment_solutions.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xjrsoft.module.customerTwo.barin.t_equipment_solutions.entity.TEquipmentSolutions;
import com.xjrsoft.module.customerTwo.barin.t_equipment_solutions.dto.TEquipmentSolutionsListDto;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import java.util.List;
import com.xjrsoft.module.customerTwo.barin.t_equipment_solutions.mapper.TEquipmentSolutionsMapper;
import com.xjrsoft.module.customerTwo.barin.t_equipment_solutions.service.ITEquipmentSolutionsService;
import com.xjrsoft.core.mp.base.BaseService;
import com.xjrsoft.core.tool.utils.Func;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;

/**
 *  服务实现类
 *
 * @author dongxinhang
 * @since 2024-11-18
 */
@Service
@AllArgsConstructor
public class TEquipmentSolutionsServiceImpl extends BaseService<TEquipmentSolutionsMapper, TEquipmentSolutions> implements ITEquipmentSolutionsService {


	@Override
	public IPage<TEquipmentSolutions> getPageList(TEquipmentSolutionsListDto pageListDto) {
		Wrapper<TEquipmentSolutions> wrapper = Wrappers.<TEquipmentSolutions>query().lambda();
		return this.page(ConventPage.getPage(pageListDto), wrapper);
	}

	@Override
	public boolean addTEquipmentSolutions(TEquipmentSolutions tEquipmentSolutions) {
		boolean isSuccess = this.save(tEquipmentSolutions);
		return isSuccess;
	}

	@Override
	public boolean updateTEquipmentSolutions(String id, TEquipmentSolutions tEquipmentSolutions) {
		tEquipmentSolutions.setFid(id);
		return this.updateById(tEquipmentSolutions);
	}

	public boolean delete(String ids) {
		List<String> idList = Func.toStrList(ids);
		if (this.removeByIds(idList)) {
			return true;
		}
		return false;
	}

}